# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kmailtransport
pkgver=20.04.3
pkgrel=0
pkgdesc="Manage mail transport"
arch="all !ppc64le !s390x !armhf !mips !mips64" # Limited by libkgapi -> qt5-qtwebengine
url="https://kontact.kde.org/"
license="LGPL-2.0-or-later"
depends_dev="kcmutils-dev kconfigwidgets-dev kwallet-dev ki18n-dev kio-dev kmime-dev akonadi-dev akonadi-mime-dev ksmtp-dev libkgapi-dev"
makedepends="$depends_dev extra-cmake-modules"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/release-service/$pkgver/src/kmailtransport-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # Requires OpenGL and running dbus

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="c49b5d5a4f58aab8bcf7a7a5bdc10df38d91caa61b05501cc57530e09a68046d527cd2bfe2fc634d64fde7fb24f41fb2ae657a9eb3bbb4b2dea2fede0ccadf93  kmailtransport-20.04.3.tar.xz"
